<template>
    <div>
        <!--<img :src="img" @click="clickImg($event)">-->
        <!-- 放大图片 -->
        <big-img  @clickit="viewImg" :imgSrc="imgSrc"></big-img>
    </div>
</template>

<script>
import BigImg from '@/view/fater/BigImg.vue';
    export default {
        data() {
            return {
                showImg:false,
                imgSrc: '',
                img:'http://img3.imgtn.bdimg.com/it/u=1166430912,1933244289&fm=200&gp=0.jpg'
            }
        },
        components: {
            'big-img':BigImg
        },
        methods: {
            clickImg(e) {
                console.log(e.currentTarget.src)
                this.showImg = true;
                // 获取当前图片地址
                this.imgSrc = e.currentTarget.src;
            },
            viewImg(){
                this.showImg = false;
            },
        },
        beforeDestroy(){
          console.log('parent:beforeDestroy')
        },
        destroyed () {
          console.log('parent:destroyed')
        },
        mounted() {
          console.log('parent:mounted')
        },
        beforeMount() {
          console.log('parent:beforeMount')
        },
        created() {
          console.log('parent:created')
        },
        beforeCreate() {
          console.log('parent:beforeCreate')
        }
    }
</script>
